﻿@using KPIS.GERP.OMVC.Classes
@{
    var ssMng = new SsMng();
    var messagePopupCount = !ssMng.IsLogin() || string.IsNullOrWhiteSpace(ssMng.EmpSeq) ? 0 : HttpHelper.GetMessageUnwarnCount(ssMng.EmpSeqI);
    ViewBag.messagePopupUnwarnCount = messagePopupCount;
}
<!DOCTYPE html>
<html lang="th">
    <head>
        <meta charset="utf-8" />
        <title>@ViewBag.Title - ERP - สถาบันรับรองคุณภาพสถานพยาบาล</title>
        <link href="~/KPIS logo.ico" rel="shortcut icon" type="image/x-icon" />
        <meta name="viewport" content="width=device-width" />
        @Styles.Render("~/Content/css")
        @Styles.Render("~/Content/themes/base/css")
        @(Html.Telerik().StyleSheetRegistrar().DefaultGroup(group => group.Compress(true).Combined(true).Add("telerik.common.css").Add("telerik.sitefinity.css"))) 
        <style type="text/css">
            .t-link {
                color: rgb(0, 78, 71);
            }
            a {
                color:rgb(0, 78, 71);
                font-weight: bold;
            }
            .DetailHeader {
                cursor: pointer;
        
            }
            .DetailHeader:hover {
                background: rgb(253, 255, 236);
                background-image: -webkit-gradient(
	                linear,
	                right bottom,
	                left bottom,
	                color-stop(0.27, #F7F7F7),
	                color-stop(0.77, #E0E0E0)
                );
                background-image: -o-linear-gradient(left, #F7F7F7 27%, #E0E0E0 77%);
                background-image: -moz-linear-gradient(left, #F7F7F7 27%, #E0E0E0 77%);
                background-image: -webkit-linear-gradient(left, #F7F7F7 27%, #E0E0E0 77%);
                background-image: -ms-linear-gradient(left, #F7F7F7 27%, #E0E0E0 77%);
                background-image: linear-gradient(to left, #F7F7F7 27%, #E0E0E0 77%);
            }
            .NotNeed {
        
            }
            .BlockContent {
                padding: 20px 20px 20px 20px;
            } 
            .right{float:right;width:70%;}
            .right30{float:right;width:30%;text-align: right;margin-right: 20px;}
        </style>
    </head>

    <body>
        <div >     
            <div class="headerDiv" >
                <table style="width: 100%" >
                    <tr>
                        <td>
                            <div id="title">
                                <table>
                                    <tr>
                                        <td style="width:160px; " align="center" valign="top">
                                            <div style="height: 10px"></div>
                                            <span class="logoTopLeft" style="color:white">
                                                G-ERP<br/>
                                            </span> 
                                        </td>
                                        <td valign="top" > 
                                            <div class="thinLineWithShadow" style="height: 36px; margin-top:10px;"/>
                                        </td>
                                        <td valign="top" style="padding: 7px;color:#4b8a89">
                                            Governmen Fiscal<br/>Management Information System
                                        </td>
                                    </tr> 
                                </table>
                            </div>
                        </td>
                        <td valign="top" >
                            <div id="userInfo" style="margin: 0 0 0 0; ">
                                @Html.Partial("_LoginPartial")
                            </div>
                        </td>
                    </tr>
                </table>
            </div>
            <div id="DivMenu">
                @Html.Partial("_Menu")
            </div> 
        </div> 
        
        <div id="body" style="margin:0 0  0 0; padding: 10px 10px 10px 10px;"> 
            <div>
                <section>
                    @RenderBody()
                </section>
            </div>
            @(Html.Telerik().Window().Name("WindowPopup")
                  .Title("มีข้อความใหม่")
                  .Draggable(true) 
                  .Visible(false) 
                  .Effects(fx => fx
                                     .Expand()
                                     .Opacity()
                                     .OpenDuration(500)
                                     .CloseDuration(500)
                  )
                  .Resizable(resizing => resizing
                                             .Enabled(true)
                                             .MinHeight(128)
                                             .MinWidth(150)
                                             .MaxHeight(500)
                                             .MaxWidth(500)
                  )
                  .Buttons(b => b.Maximize().Close())
                  .Content(@<text>
                                <div style="background-color: rgb(249, 249, 249); width: 100%;height:100%">
                                    <a href="@Url.Action("TaskMessageInbox", "ApprovalTask")">
                                        <div style='background: url(@Url.Content("~/Images/Icons/add_mail.png")) no-repeat center; width:150px; height:128px;'>
                                            <br/><br/><br/>
                                            <div style="text-decoration: none;color:rgb(0, 130, 198); font-weight: bolder; text-shadow: 2px 2px #a5a5a5; "> 
                                                &nbsp; &nbsp; &nbsp;  
                                                <span style="font-size:xx-large;text-decoration: none;">@messagePopupCount</span>
                                            </div> 
                                        </div>
                                    </a>
                                </div>
                            </text>)
                  .ClientEvents(events => events.OnLoad("Window_onLoad"))
                  )
        </div>
        
        <footer>
            <div class="divCompany">
                &copy; @DateTime.Now.Year - KPIS & MarsTech. &nbsp;&nbsp;
            </div>
        </footer>
        @Scripts.Render("~/bundles/jquery")
        @Scripts.Render("~/bundles/modernizr")
        @Scripts.Render("~/bundles/jqueryui")

        @*@Scripts.Render("~/bundles/jquerytablesorter") 
        @Scripts.Render("~/bundles/jquerytablesorterpager") 
        @Scripts.Render("~/bundles/jquerytablesorterwidgetsfilterformat") 
        @Scripts.Render("~/bundles/jquerytablesorterwidgets") *@
        
        <script src="~/Scripts/jquery.tablesorter.js"></script>
        <script src="~/Scripts/jquery.tablesorter.pager.js"></script>
        <script src="~/Scripts/jquery.tablesorter.widgets-filter-formatter.js"></script>
        <script src="~/Scripts/jquery.tablesorter.widgets.js"></script>


        @if(ViewBag.RenderValidate == true)
        {
            @Scripts.Render("~/Scripts/jquery.validate.min.js")
            @Scripts.Render("~/Scripts/jquery.validate.unobtrusive.min.js")
        }
        @RenderSection("scripts", required: false)
        @(Html.Telerik().ScriptRegistrar().Globalization(true).DefaultGroup(group => group.Compress(true).Combined(true)))
        
        
        <script type="text/javascript">
            var myTimer;
            var myWindow;
            $(document).ready(function () {

                $("#highlightNewMessage").click(function () {
                    $(this).effect("highlight", {}, 1000);
                });

                $("#btnShowHide").click(function () {
                    $("#paragraph").slideToggle();
                });

                $('#btnTakeActionA').click(function () {
                    $('#ActionStringHdf').val('A');
                    $(this).closest('form')[0].submit();
                });

                $('#btnTakeActionF').click(function () {
                    $('#ActionStringHdf').val('F');
                    $(this).closest('form')[0].submit();
                });

                $('#btnTakeActionN').click(function () {
                    $('#ActionStringHdf').val('N');
                    $(this).closest('form')[0].submit();
                });

                $('#btnTakeActionJ').click(function () {
                    $('#ActionStringHdf').val('J');
                    $(this).closest('form')[0].submit();
                });

                $('#btnTakeActionC').click(function () {
                    $('#ActionStringHdf').val('C');
                    $(this).closest('form')[0].submit();
                });
            });

            function popop_close() {
                window.clearInterval(myTimer);
                myWindow.close();
            }
                function Window_onLoad() {

                    @if(messagePopupCount > 0)
                    {
                        <text>
                            myTimer = setInterval('popop_close()', 8000);
                            myWindow = $(this).data('tWindow');
                            myWindow.bottomright().open();
                        </text>

                    }
            }
        </script>
        
    </body>
</html>
@if (!ssMng.IsLogin() && (ViewBag.ThisPageIsLogin == null || ViewBag.ThisPageIsLogin != "Yes"))
{
    new SsMng { tempRedirectUrl = Common.IssueNotLoginUrl }.CheckUss();
}